package com.mhjy.synchro.controller;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.mhjy.synchro.repository.model.BaseResultModel;
import com.mhjy.synchro.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api("长者信息接口")
@RestController
@RequestMapping("/api/baseInfo")
public class BaseInfoController {

    @Autowired
    private IOldieBaseInfoService oldieBaseInfoService;

    @Autowired
    private IRefundApplicationDetailService refundApplicationDetailService;

    @Autowired
    private IRefundApplicationSummaryService refundApplicationSummaryService;

    @Autowired
    private ISettlementRecordDetailService settlementRecordDetailService;

    @Autowired
    private ISettlementRecordSummaryService settlementRecordSummaryService;

    @Autowired
    private ISynchroService synchroService;

    @ApiOperation(value = "getObieAll", notes = "获取全部长者信息")
    @RequestMapping(value = "/getObieAll", method = RequestMethod.GET)
    public BaseResultModel GetObieAll(){
        return oldieBaseInfoService.GetAll();
    }

    @ApiOperation(value = "GetRefundDetail", notes = "获取退款详细")
    @RequestMapping(value = "/GetRefundDetail", method = RequestMethod.GET)
    public BaseResultModel GetRefundDetail(){
        return  refundApplicationDetailService.GetAll();
    }

    @ApiOperation(value = "GetRefundSummary", notes = "获取退款")
    @RequestMapping(value = "/GetRefundSummary", method = RequestMethod.GET)
    public BaseResultModel GetRefundSummary(){
        return refundApplicationSummaryService.GetAll();
    }

    @ApiOperation(value = "GetSettlementRecordDetail", notes = "结算缴费记录明细")
    @RequestMapping(value = "/GetSettlementRecordDetail", method = RequestMethod.GET)
    public BaseResultModel GetSettlementRecordDetail(){
        return  settlementRecordDetailService.GetAll();
    }

    @ApiOperation(value = "GetSettlementRecordSummary", notes = "结算缴费记录")
    @RequestMapping(value = "/GetSettlementRecordSummary", method = RequestMethod.GET)
    public BaseResultModel GetSettlementRecordSummary(){
        return  settlementRecordSummaryService.GetAll();
    }


    @ApiOperation(value = "SynchroMember", notes = "同步老人信息")
    @RequestMapping(value = "/SynchroMember", method = RequestMethod.GET)
    public  BaseResultModel GetSynchroMember() throws JsonProcessingException {

        return  synchroService.SynchroMember();
    }


//    @ApiOperation(value = "SynchroSoMember", notes = "同步费用信息")
//    @RequestMapping(value = "/SynchroSoMember", method = RequestMethod.GET)
//    public BaseResultModel  SynchroSoMember() throws JsonProcessingException {
//     return  synchroService.SynchroSoMaster();
//    }

    @ApiOperation(value = "SynchroSoDetail", notes = "同步费用详细信息")
    @RequestMapping(value = "/SynchroSoDetail", method = RequestMethod.GET)
    public BaseResultModel  SynchroSo() throws JsonProcessingException {
        return  synchroService.SynchroSoDetail();
    }
}
